Skip to content

Turn off the density reset during ZACHeB in hb_2M - #1140

Merged
Debraheem merged 1 commit into
mainfrom
EbF/hb2m_remove_set_rho_dm_dv
Nov 26, 2026
Merged

Debraheem merged 1 commit into
mainfrom
EbF/hb2m_remove_set_rho_dm_dv

Conversation

@Debraheem

Copy link
Copy Markdown
Member

This PR temporarily fixes the hb_2M failure on main. I think it points to a deeper issue in the radius reconstruction scheme that adjusts the cell densities at the start of each step.

To make the densities consistent with shell volumes, MESA reconstructs the density at the start of each step, using rho = dm(k)/delta_V. For an interior shell, this is

s% rho(k) = s% dm(k) / ((4*pi/3) * (s% r(k)**3 - s% r(k+1)**3))

Here s% r(k) = exp(s% lnR(k)). The difference can hit precision limits when the cell is very thin and sits at a large radius. In cell 1381 of accepted model 2016, the two faces were

s% lnR(1381) = 20.536812559190682
s% lnR(1382) = 20.536812517899872
s% r(1381)   = 829897335.71157944 cm
s% r(1382)   = 829897301.44444633 cm

The shell was only about 34 cm thick. Cubing and differencing those radii changed the density from 22216.10548 to 22216.10677 g/cm³, an increase of about 5.8e⁻⁸ relative.

At face 1380 of the attempted model 2017, that small density change was enough to shrink the EOS pressure interval from 6.50e⁻⁸ to 7.83e⁻¹⁰ in magnitude in ln P. That made the Brunt composition term about 83 times larger in magnitude. A large temperature correction in a nearby burning cell then sent the energy residual up, and the retries eventually hit the minimum timestep. The inlist uses convergence_ignore_equL_residuals = .true. during the flash. Including that residual in the convergence check still reproduced the failure.

Merely turning off the reconstruction with set_rho_to_dm_div_dV = .false. gets this test through the flash. If we want to keep the reconstruction, we still need to fix the precision issue.

I’ve drafted a PR that reconstructs radii and densities in a potentially more robust way, with the same goal as in MESA I, Section 6.2. That could affect MESA globally, so I don’t want to rush it in just to fix this one test case. Draft #1136 · MESA I

For this test case, I set set_rho_to_dm_div_dV = .false. in the ZACHeB inlist, regenerated the saved models, and opened an issue for the reconstruction. Issue #1139

Locally, ZACHeB reached HB_limit at model 2240. The final core helium burning stage reached helium depletion and reported all values are within tolerance.

Set set_rho_to_dm_div_dV to false during the helium flash and
regenerate the TAMS and ZACHeB fixtures. The test reaches HB_limit
and passes the subsequent core helium burning check.

See #1136 for the reconstruction work.
@Debraheem
Debraheem requested a review from annethoul as a code owner November 26, 2026 21:28
@Debraheem
Debraheem merged commit e38f52a into main Nov 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant